<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:py="http://genshi.edgewall.org/">
  <xi:include href="discussion-macros.html"/>
  <xi:include href="layout.html"/>
  <head>
    <title>Add Forum</title>
  </head>

 <body>
    <xi:include href="discussion-header.html"/>

    <div id="content" class="discussion">
      <div id="${discussion.mode}" class="${discussion.mode}">
        <h1 class="subpage_title">Add Forum</h1>

        <form class="add_form" method="post" action="${href.discussion()}">
          <fieldset>

            <div class="field">
              <label for="name">Name:</label><br/>
              <input type="text" id="name" name="name" value=""/><br/>
            </div>

            <div class="field">
              <label for="subject">Subject:</label><br/>
              <input type="text" id="subject" name="subject" value=""/><br/>
            </div>

            <div class="field">
              <label for="description">Description:</label><br/>
              <input type="text" id="description" name="description"
                value=""/><br/>
            </div>

            <div class="field">
              <label for="moderators">Moderators:</label><br/>
              <py:choose>
                <select py:when="len(discussion.users) > 0 and 7 >
                  len(discussion.users)" id="moderators" name="moderators"
                  multiple="on">
                  <option py:for="user in discussion.users" value="${user}">
                    ${user}</option>
                </select>
                <select py:when="len(discussion.users) > 6" id="moderators"
                  name="moderators" size="6" multiple="on">
                  <option py:for="user in discussion.users" value="${user}">
                    ${user}</option>
                </select>
                <input py:otherwise="" type="text" id="moderators"
                  name="moderators" value=""/>
              </py:choose><br/>
            </div>

            <py:choose>
              <div py:when="len(discussion.groups) > 1" class="group">
                <label for="group">Forum group:</label><br/>
                <select id="group" name="group">
                  <option py:for="group in discussion.groups"
                    value="${group.id}">${group.name}</option>
                </select><br/>
              </div>
              <input py:otherwise="" type="hidden" id="group" name="group"
                value="0"/>
            </py:choose>

            <div class="field">
              <label for="subscribers">Registered subscribers:</label>
              <br/>
              <py:choose>
                <select py:when="len(discussion.users) > 0 and 7 >
                  len(discussion.users)" id="subscribers" name="subscribers"
                  multiple="on">
                  <option py:for="user in discussion.users" value="${user}">
                    ${user}</option>
                </select>
                <select py:when="len(discussion.users) > 6" id="subscribers"
                  name="subscribers" size="6" multiple="on">
                  <option py:for="user in discussion.users" value="${user}">
                    ${user}</option>
                </select>
              </py:choose>
              <br/>
            </div>

            <div class="field">
              <label for="unregistered_subscribers">Unregistered subscribers
                (e-mails):</label>
              <br/>
              <input type="text" id="unregistered_subscribers"
                name="unregistered_subscribers" value=""/>
              <br/>
            </div>

            <div py:if="discussion.authemail" class="field">
              <label for="subscribe">
                <input py:if="discussion.authname in
                  discussion.forum.subscribers" type="checkbox" name="subscribe"
                  id="subscribe"  checked="yes" value="1"
                  onchange="subscription_select('${discussion.authname}',
                    this.checked)"/>
                <input py:if="not (discussion.authname in
                  discussion.forum.subscribers)" type="checkbox"
                  name="subscribe" id="subscribe" value="0"
                  onchange="subscription_select('${discussion.authname}',
                    this.checked)"/>
                Subscribe to forum.
              </label><br/>
            </div>

            <div class="buttons">
				<span class="secondaryButton">
					<input type="submit" name="submit" value="Submit" />
				</span> 
				<span class="secondaryButton">
					<input type="button" name="cancel" value="Cancel" onclick="location.href = '${href.discussion()}'"/>
				</span> 
              <input type="hidden" name="discussion_action" value="post-add"/>
            </div>
          </fieldset>
        </form>

      </div>
    </div>

    <xi:include href="discussion-footer.html"/>
  </body>
</html>
